package com.action;


import com.service.WxLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.UnsupportedEncodingException;

@RestController
@RequestMapping("/api/weixin")
@CrossOrigin("*")
public class WxLogin {

    @Autowired
    private WxLoginService wxLoginService;

    @RequestMapping("/login")
    public String login(String code, String nick, String head,String miwen,String iv) throws UnsupportedEncodingException {
        wxLoginService.saveOrUpdateWeixinInfo(code,nick,head,miwen,iv);
        return "success";
    }
}
